//
//  UIView+FKAdd.m
//  FKSlideController
//
//  Created by 云眼科技 on 16/6/30.
//  Copyright © 2016年 CloudEyes. All rights reserved.
//

#import "UIView+FKAdd.h"

@implementation UIView (FKAdd)

-(CGFloat)view_x{
    return self.frame.origin.x;
}

-(void)setView_x:(CGFloat)view_x{
    CGRect frame = self.frame;
    frame.origin.x = view_x;
    self.frame = frame;
}

-(CGFloat)view_y{
    return self.frame.origin.y;
}

-(void)setView_y:(CGFloat)view_y{
    CGRect frame = self.frame;
    frame.origin.y = view_y;
    self.frame = frame;
}

-(CGFloat)view_width{
    return self.frame.size.width;
}

-(void)setView_width:(CGFloat)view_width{
    CGRect frame = self.frame;
    frame.size.width = view_width;
    self.frame = frame;
}

-(CGFloat)view_height{
    return self.frame.size.height;
}

-(void)setView_height:(CGFloat)view_height{
    CGRect frame = self.frame;
    frame.size.height = view_height;
    self.frame = frame;
}

-(CGFloat)view_centerX{
    return self.center.x;
}

-(void)setView_centerX:(CGFloat)view_centerX{
    CGPoint center = self.center;
    center.x = view_centerX;
    self.center = center;
}

-(CGFloat)view_centerY{
    return self.center.y;
}

-(void)setView_centerY:(CGFloat)view_centerY{
    CGPoint center = self.center;
    center.y = view_centerY;
    self.center = center;
}

-(CGPoint)view_origin{
    return self.frame.origin;
}

-(void)setView_origin:(CGPoint)view_origin{
    CGRect frame = self.frame;
    frame.origin = view_origin;
    self.frame = frame;
}

-(CGSize)view_size{
    return self.frame.size;
}

-(void)setView_size:(CGSize)view_size{
    CGRect frame = self.frame;
    frame.size = view_size;
    self.frame = frame;
}


-(void)makeTransformWithScale:(CGFloat)scale{
    [UIView animateWithDuration:0.2 animations:^{
        self.transform = CGAffineTransformScale(CGAffineTransformIdentity, scale, scale); 
    }];
}

-(void)makeTransformIdentity{
    [UIView animateWithDuration:0.2 animations:^{
        self.transform = CGAffineTransformIdentity;
    }];
}

-(void)makeMoveWithPoint:(CGPoint)point{
    [UIView animateWithDuration:0.2 animations:^{
        self.center = point;
    }];
}

@end
